package com.youyi.yychosesdk.SDK;

import android.content.Context;
import android.content.Intent;
import com.youyi.yychosesdk.models.album.entity.Photo;
import java.util.ArrayList;

public class YYChoseSDK {
    public static OnSelectListener mOnSelectListener;
    private static final YYChoseSDK ourInstance = new YYChoseSDK();
    private Context mContext;

    public interface OnSelectListener {
        void onCancel();

        void onResult(ArrayList<Photo> arrayList, boolean z);
    }

    public static YYChoseSDK getInstance(Context context) {
        YYChoseSDK yYChoseSDK = ourInstance;
        yYChoseSDK.initContext(context);
        return yYChoseSDK;
    }

    private void initContext(Context context) {
        this.mContext = context;
    }

    private YYChoseSDK() {
    }

    public void camera(OnSelectListener onSelectListener) {
        mOnSelectListener = onSelectListener;
        Intent intent = new Intent(this.mContext, YYChoseSDKActivity.class);
        intent.addFlags(335544320);
        intent.putExtra("choseType", ChoseType.Camera.toString());
        this.mContext.startActivity(intent);
    }

    public void chosePic(boolean z, int i, OnSelectListener onSelectListener) {
        mOnSelectListener = onSelectListener;
        Intent intent = new Intent(this.mContext, YYChoseSDKActivity.class);
        intent.addFlags(335544320);
        intent.putExtra("choseType", ChoseType.Img.toString());
        intent.putExtra("showCamera", z);
        intent.putExtra("num", i);
        this.mContext.startActivity(intent);
    }

    public void choseVideo(int i, OnSelectListener onSelectListener) {
        mOnSelectListener = onSelectListener;
        Intent intent = new Intent(this.mContext, YYChoseSDKActivity.class);
        intent.addFlags(335544320);
        intent.putExtra("choseType", ChoseType.Video.toString());
        intent.putExtra("num", i);
        this.mContext.startActivity(intent);
    }

    public void choseGif(int i, OnSelectListener onSelectListener) {
        mOnSelectListener = onSelectListener;
        Intent intent = new Intent(this.mContext, YYChoseSDKActivity.class);
        intent.addFlags(335544320);
        intent.putExtra("choseType", ChoseType.Gif.toString());
        intent.putExtra("num", i);
        this.mContext.startActivity(intent);
    }
}
